home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 118_01.zip / ROFF.H < prev    next >
Text File  |  1993-06-03  |  5KB  |  166 lines

  1. /* software tools format program -- C version -- header file
  2.  * source:  roff.h
  3.  * version: November 26, 1981.
  4.  */
  5.  
  6. /* contains the following common blocks:
  7.  
  8.     ctemp
  9.     cparam
  10.     cpage
  11.     cout
  12.     cnr
  13.     cfiles
  14.     cdefio
  15.     cmac
  16. */
  17.  
  18.  
  19. /*     define PAGECONTROL if you want format to output a
  20.  *     page eject character (CNTRL-L) rather than count
  21.  *     lines to finish off a page.
  22.  */
  23.  
  24. /* comment out -----
  25. #define PAGECONTROL 1
  26. ----- end comment out */
  27.  
  28.  
  29. /* define size of important data objects */
  30.  
  31. #define MAXLINE 400
  32. #define MAXDEF  400
  33. #define MAXNAME 400
  34. #define    INSIZE    400 
  35. #define    MAXOUT    400 
  36. #define PBSIZE  400
  37.  
  38. /* define special characters visible to the user */
  39.  
  40. #define ARGFLAG '$'
  41. #define    PAGENUM    '#'
  42. #define    CURRENTDATE '%'
  43.  
  44. /* define default settings of parameters */
  45.  
  46. #define    PAGEJECT FF    /* FF is ASCII formfeed (control-L) */
  47. #define    PAGEWIDTH 65 
  48. #define    PAGELEN    66 
  49.  
  50. /* define return codes and other values */
  51.  
  52. #define    LEFT    1 
  53. #define    CENTER    2 
  54. #define    RIGHT    3 
  55. #define    STARTU    1    /* start underscoring */
  56. #define    STOPU    2    /* stop underscoring */
  57.  
  58.  
  59. /* these variable were originally local variables
  60.  * initialized with data statements.
  61.  */
  62.  
  63. int  cuflag;        /* cuflg in text() */
  64. int  dir;        /* dir    in spread() */
  65. int  putflag;        /* cuflg in put() */
  66.  
  67. /* temporary buffers -- from common block ctemp */
  68.  
  69. char tbuf1 [MAXLINE];    /* for use by puttl and tabs */
  70. char tbuf2 [MAXLINE];
  71. char ttl   [MAXLINE];
  72.  
  73.  
  74. /* misc. line info -- from common block cparam */
  75.  
  76. int  fill;    /* flag: fill; init = YES */
  77. int  lsval;    /* line spacing; init = 1 */
  78. int  inval;    /* indent; >= 0; init = 0 */
  79. int  rmval;    /* right margin; init = PAGEWIDTH = 60 */
  80. int  tival;    /* current temporary indent; init = 0 */
  81. int  ceval;    /* number of lines to center; init = 0 */
  82. int  ulval;    /* number of lines to underline; init = 0 */
  83. int  boval;    /* number of lines to boldface; init = 0 */
  84. char cchar;    /* line control character; init = PERIOD */
  85. int  tjust [3];    /* justification types for heads and foots */
  86.         /* init = LEFT, CENTER, RIGHT */
  87. int  bsval;    /* number of lines to blank suppress; init=0 */
  88. int  rjust;    /* flag: right justify filled lines */
  89.         /* init = YES */
  90. int  cuval;    /* number of lines to continuously underline */
  91.         /* init = 0 */
  92. int  tabs [INSIZE];    /* tab stops; init every 8 spaces */
  93.  
  94.  
  95. /* misc. page info -- from common block cpage */
  96.  
  97. int  curpag;    /* current output page number; init = 0 */
  98. int  newpag;    /* next output page number; init = 1 */
  99. int  lineno;    /* next line to be printed; init = 0 */
  100. int  plval;    /* page length in lines; init = PAGELEN = 66 */
  101. int  m1val;    /* margin before and including header */
  102. int  m2val;    /* margin after header */
  103. int  m3val;    /* margin after last text line */
  104. int  m4val;    /* bottom margin, including footer */
  105. int  bottom;    /* last live line on page */
  106.         /* always equal to plval - m3val - m4val */
  107. char ehead [MAXLINE];    /* top of page title for even pages */
  108.             /* init = NEWLINE */
  109. char ohead [MAXLINE];    /* top of page title for odd  pages */
  110. int  ehlim [2];        /* left,right margins for even header */
  111.             /* init = inval, rmval */
  112. int  ohlim [2];        /* left,right margins for odd  header */
  113.             /* init = inval, rmval */
  114. char efoot [MAXLINE];    /* bot of page title for even pages */
  115.             /* init = NEWLINE */
  116. char ofoot [MAXLINE];    /* bot of page title for odd  pages */
  117.             /* init = NEWLINE */
  118. int  eflim [2];        /* left,right margins for even footer */
  119.             /* init = inval, rmval */
  120. int  oflim [2];        /* left,right margins for odd  footer */
  121.             /* init = inval, rmval */
  122. int  stopx;        /* flag for pausing between pages */
  123. int  frstpg;        /* first page to begin printing with */
  124. int  lastpg;        /* last page to be printed */
  125. int  print;        /* print page flag */
  126. int  offset;        /* offset whole page by this much */
  127.             /* init = 0 */
  128.  
  129.  
  130. /* output lines and related info -- from common block cout */
  131.  
  132. int  outp;    /* last char position in outbuf; init = 0 */
  133. int  outw;    /* width of text in outbuf; init = 0 */
  134. int  outwds;    /* number of words in outbuf; init = 0 */
  135. char outbuf [MAXOUT];    /* lines to be filled collect here */
  136.             /* word in outbuf; init=0 */
  137.  
  138.  
  139. /* number registers -- from common block cnr */
  140.  
  141. int  nr [26];    /* number registers a..z */
  142.  
  143.  
  144. /* list of input files -- from common block cfiles */
  145.  
  146. int  infile [SYS_STD + MAXOFILES]; /* file descriptor stack */
  147. int  level;        /* current file is infile[level] */
  148.  
  149.  
  150. /* pushed-back input characters -- from common block cdefio */
  151.  
  152. int  bp;        /* next available character; init = 0 */
  153. char pbbuf [PBSIZE];    /* pushed-back characters */
  154.  
  155.  
  156. /* symbol table for macros -- from common block cmac */
  157.  
  158. char *    mactbl;        /* symbol table containing macros */
  159.  infile [SYS_STD + MAXOFILES]; /* file descriptor stack */
  160. int  level;        /* current file is infile[level] */
  161.  
  162.  
  163. /* pushed-back input characters -- from common block cdefio */
  164.  
  165. int  bp;        /* next available character; init = 0 */
  166. char pbbuf [PBSIZE];    /